package com.ss.android.mine;

import android.content.SharedPreferences;
import android.view.View;
import android.widget.TextView;

import com.bytedance.common.utility.c.SharedPreferenceCompat;
import com.ss.android.article.base.app.AppData;
import com.ss.android.article.browser.R;
import com.ss.android.common.ui.view.SwitchButton;
import com.ss.android.newmedia.activity.FragmentActivity;

public class DevelopActivity extends FragmentActivity {
    public DevelopActivity() {

    }

    public int getLayout() {
        return R.layout.ce;
    }

    public void init() {
        boolean v1 = true;
        super.init();
        this.mTitleView.setText(com.ss.android.article.browser.R.string.ut);
        ((TextView)this.findViewById(com.ss.android.article.browser.R.id.qn)).setText("使用点播SDK（再次冷启动生效）");
        View v0 = this.findViewById(com.ss.android.article.browser.R.id.qo);
        ((SwitchButton)v0).setChecked(AppData.getInstance().isTTEngineEnable());
        ((SwitchButton)v0).setOnCheckStateChangeListener(new w());
        ((TextView)this.findViewById(com.ss.android.article.browser.R.id.qp)).setText("使用自研播放器");
        v0 = this.findViewById(com.ss.android.article.browser.R.id.qq);
        ((SwitchButton)v0).setChecked(AppData.getInstance().isTTPlayerEnable());
        ((SwitchButton)v0).setOnCheckStateChangeListener(new x());
        ((TextView)this.findViewById(com.ss.android.article.browser.R.id.qr)).setText("点播SDK使用单独进程");
        v0 = this.findViewById(com.ss.android.article.browser.R.id.qs);
        ((SwitchButton)v0).setChecked(AppData.getInstance().h());
        ((SwitchButton)v0).setOnCheckStateChangeListener(new y());
        ((TextView) this.findViewById(com.ss.android.article.browser.R.id.qt)).setText("是否拉取搜索推荐词");
        v0 = this.findViewById(com.ss.android.article.browser.R.id.qu);
        ((SwitchButton)v0).setChecked(AppData.getInstance().mSearchRecommend);
        ((SwitchButton)v0).setOnCheckStateChangeListener(new z());
        ((TextView)this.findViewById(com.ss.android.article.browser.R.id.qv)).setText("搜索页是否使用搜索推荐wap页");
        v0 = this.findViewById(com.ss.android.article.browser.R.id.qw);
        ((SwitchButton)v0).setChecked(AppData.getInstance().mSearchRecommendCount);
        ((SwitchButton)v0).setOnCheckStateChangeListener(new SwitchButton.a() {
            public final boolean a(boolean arg4) {
                AppData v0 = AppData.getInstance();
                v0.mSearchRecommendCount = arg4;
                SharedPreferences.Editor v0_1 = v0.mContext.getSharedPreferences("app_setting", 0).edit();
                v0_1.putBoolean("search_recommend_count", arg4);
                SharedPreferenceCompat.commit(v0_1);
                return true;
            }
        });
        ((TextView) this.findViewById(com.ss.android.article.browser.R.id.qx)).setText("搜索推荐词拉取数量是否为1");
        v0 = this.findViewById(com.ss.android.article.browser.R.id.qy);
        if(AppData.getInstance().mSearchRecommendTextCount != 1) {
            v1 = false;
        }

        ((SwitchButton)v0).setChecked(v1);
        ((SwitchButton)v0).setOnCheckStateChangeListener(new SwitchButton.a() {

            public final boolean a(boolean arg6) {
                AppData v2 = AppData.getInstance();
                int v0 = arg6 ? 1 : 3;
                v2.mSearchRecommendTextCount = v0;
                SharedPreferences.Editor v2_1 = v2.mContext.getSharedPreferences("app_setting", 0).edit();
                v2_1.putInt("search_recommend_text_count", v0);
                SharedPreferenceCompat.commit(v2_1);
                return true;
            }
        });
    }
}

